#!/usr/bin/env python
# -*- coding: utf-8 -*-


import itertools


def anyTrue(predicate, sequence):
    return True in itertools.imap(predicate, sequence)


def endsWith(s, *endings):
    '''增强版的s.endswith,可以判断多个后缀

       import os

       for f in os.listdir('.'):
           if endsWith(f,'pyc','py'):
               print f
    '''
    return anyTrue(s.endswith, endings)


__all__ = [anyTrue, endsWith]
